//
//  ZJKComposeMenuButton.swift
//  MicroBlog
//
//  Created by VAD on 16/4/25.
//  Copyright © 2016年 朱江坤. All rights reserved.
//

import UIKit

class ZJKComposeMenuButton: UIButton {
    
    override var highlighted: Bool{
        get{
            return false
        }
        
        set{
            
        }
        
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        
        titleLabel?.textAlignment = .Center
        
        imageView?.contentMode = .Center
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        // 调整 imageView 的宽高
        self.imageView?.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.width)
        
        // 调整label
        self.titleLabel?.frame = CGRect(x: 0, y: self.frame.width, width: self.frame.width, height: self.frame.height - self.frame.width)

    }

}
